package day52.basic.controller;

import day52.basic.domain.dto.SmsRegisteDto;
import day52.basic.service.IResetService;
import day52.basic.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/reset")
public class ResetController {
    @Autowired
    private IResetService resetService;

    @PostMapping("/sms")
    public AjaxResult resetUserPassword(@RequestBody @Valid SmsRegisteDto dto){
        resetService.resetUserPassword(dto);
        return AjaxResult.me();
    }
}
